<?php /*a:2:{s:68:"D:\phpStudy\WWW\tp5\application\admin\view\admin_lab\lab_update.html";i:1548754941;s:58:"D:\phpStudy\WWW\tp5\application\admin\view\admin\head.html";i:1550326401;}*/ ?>
 <!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>广州商学院lms-后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" type="text/css" href="/static/lib/layui/css/layui.css" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery.js"></script>
    <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-body">
    <form class="layui-form">
    <div class="layui-form-item">
        <label for="" class="layui-form-label">课室名称</label>
        <div class="layui-input-block">
            <input type="text" id="name" class="layui-input" placeholder="请输入课室名称" value="<?php echo htmlentities($lab['name']); ?>">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="" class="layui-form-label">课室地址</label>
        <div class="layui-input-block">
            <input type="text" id="address" class="layui-input" placeholder="请输入课室地址" value="<?php echo htmlentities($lab['address']); ?>">
        </div>
    </div>
    <div class="layui-form-item">
        <label for="" class="layui-form-label">承载人数</label>
        <div class="layui-input-inline">
            <input type="text" id="people" class="layui-input" placeholder="请输入承载人数" value="<?php echo htmlentities($lab['people']); ?>">
        </div>
        <div class="layui-form-mid">
            只可以输入数字
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">管理教师</label>
        <div class="layui-input-inline">
            <select lay-verify="required" name="teacher_id" id="teacher_id">
                <option value="" id="null"></option>
                <?php if(is_array($teachers) || $teachers instanceof \think\Collection || $teachers instanceof \think\Paginator): $i = 0; $__LIST__ = $teachers;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$teacher): $mod = ($i % 2 );++$i;?>
                <option value="<?php echo htmlentities($teacher['id']); ?>"  <?php if($lab['teacher_id'] == $teacher['id']): ?>selected="selected"<?php endif; ?>><?php echo htmlentities($teacher['realname']); ?></option>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" type="button" onclick="fuck()">修改课室</button>
        </div>
    </div>
    </form>
</div>

<script>
    function fuck() {
        $.post(
            "",
            {
                name:$('#name').val(),
                address:$('#address').val(),
                people:$('#people').val(),
                teacher_id:$('#teacher_id').val()
            },
            function (data) {
                layui.use('layer', function(){
                    var layer = layui.layer;
                    if (data.statu==200){
                        layer.msg(data.msg);
                        $('#name').val('');
                        $('#address').val('');
                        $('#people').val('');
                    } else {
                        layer.msg(data.msg);
                    }
                });
            }
        )
    }
</script>
</body>

</html>